package com.hilog.productservice.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Map;

/**
 * 支付服务Feign客户端
 */
@FeignClient(name = "payment-service", url = "http://localhost:8083")
public interface PaymentFeignClient {

    /**
     * 调用支付服务的扣款接口
     * @param orderId 订单ID
     * @param traceId 链路追踪ID
     * @return 扣款结果
     */
    @GetMapping("/payment/deduct/{orderId}")
    Map<String, Object> deductPayment(@PathVariable("orderId") String orderId,
                                      @RequestHeader("X-Trace-Id") String traceId);
} 